package com.ruoyi.caiwu.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.caiwu.mapper.AccountingVoucherAttachmentMapper;
import com.ruoyi.caiwu.domain.AccountingVoucherAttachment;
import com.ruoyi.caiwu.service.IAccountingVoucherAttachmentService;

/**
 * 凭证附件Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-25
 */
@Service
public class AccountingVoucherAttachmentServiceImpl implements IAccountingVoucherAttachmentService
{
    @Autowired
    private AccountingVoucherAttachmentMapper accountingVoucherAttachmentMapper;

    /**
     * 查询凭证附件
     *
     * @param attachmentId 凭证附件主键
     * @return 凭证附件
     */
    @Override
    public AccountingVoucherAttachment selectAccountingVoucherAttachmentByAttachmentId(Long attachmentId)
    {
        return accountingVoucherAttachmentMapper.selectAccountingVoucherAttachmentByAttachmentId(attachmentId);
    }

    /**
     * 查询凭证附件列表
     *
     * @param accountingVoucherAttachment 凭证附件
     * @return 凭证附件
     */
    @Override
    public List<AccountingVoucherAttachment> selectAccountingVoucherAttachmentList(AccountingVoucherAttachment accountingVoucherAttachment)
    {
        return accountingVoucherAttachmentMapper.selectAccountingVoucherAttachmentList(accountingVoucherAttachment);
    }

    /**
     * 新增凭证附件
     *
     * @param accountingVoucherAttachment 凭证附件
     * @return 结果
     */
    @Override
    public int insertAccountingVoucherAttachment(AccountingVoucherAttachment accountingVoucherAttachment)
    {
        return accountingVoucherAttachmentMapper.insertAccountingVoucherAttachment(accountingVoucherAttachment);
    }

    /**
     * 修改凭证附件
     *
     * @param accountingVoucherAttachment 凭证附件
     * @return 结果
     */
    @Override
    public int updateAccountingVoucherAttachment(AccountingVoucherAttachment accountingVoucherAttachment)
    {
        return accountingVoucherAttachmentMapper.updateAccountingVoucherAttachment(accountingVoucherAttachment);
    }

    /**
     * 批量删除凭证附件
     *
     * @param attachmentIds 需要删除的凭证附件主键
     * @return 结果
     */
    @Override
    public int deleteAccountingVoucherAttachmentByAttachmentIds(Long[] attachmentIds)
    {
        return accountingVoucherAttachmentMapper.deleteAccountingVoucherAttachmentByAttachmentIds(attachmentIds);
    }

    /**
     * 删除凭证附件信息
     *
     * @param attachmentId 凭证附件主键
     * @return 结果
     */
    @Override
    public int deleteAccountingVoucherAttachmentByAttachmentId(Long attachmentId)
    {
        return accountingVoucherAttachmentMapper.deleteAccountingVoucherAttachmentByAttachmentId(attachmentId);
    }
}
